﻿<xctk:ColorPicker
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
	mc:Ignorable="d"
	x:Class="SeismicResponseSpectrum.Ui.CustomColorPicker"
	x:Name="UserControl"
	d:DesignWidth="473.885" d:DesignHeight="270.063" Cursor="Hand"  >
	<xctk:ColorPicker.Resources>
		<Style x:Key="ColorPickerStyle1" TargetType="{x:Type xctk:ColorPicker}">
			<Setter Property="Background" Value="White"/>
			<Setter Property="BorderBrush">
				<Setter.Value>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FFA3AEB9" Offset="0"/>
						<GradientStop Color="#FF8399A9" Offset="0.375"/>
						<GradientStop Color="#FF718597" Offset="0.375"/>
						<GradientStop Color="#FF617584" Offset="1"/>
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
			<Setter Property="BorderThickness" Value="1,1,0,1"/>
			<Setter Property="ButtonStyle">
				<Setter.Value>
					<Style TargetType="{x:Type ToggleButton}">
						<Setter Property="Template">
							<Setter.Value>
								<ControlTemplate TargetType="{x:Type ToggleButton}">
									<Grid SnapsToDevicePixels="True">
										<Grid>
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="*"/>
												<ColumnDefinition Width="Auto"/>
											</Grid.ColumnDefinitions>
											<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
												<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
											</Border>
											<xctk:ButtonChrome x:Name="ToggleButtonChrome" Grid.Column="1" CornerRadius="0,2.75,2.75,0" InnerCornerRadius="0,1.75,1.75,0" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderChecked="{Binding IsOpen, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type xctk:ColorPicker}}}" RenderEnabled="{Binding IsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type xctk:ColorPicker}}}" Width="0">
												<xctk:ButtonChrome.Visibility>
													<Binding Path="ShowDropDownButton" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type xctk:ColorPicker}}">
														<Binding.Converter>
															<BooleanToVisibilityConverter/>
														</Binding.Converter>
													</Binding>
												</xctk:ButtonChrome.Visibility>
												<Grid x:Name="arrowGlyph" Grid.Column="1" IsHitTestVisible="False" Margin="5">
													<Path x:Name="Arrow" Data="M0,1C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1z" Fill="Black" Height="4" Width="7"/>
												</Grid>
											</xctk:ButtonChrome>
										</Grid>
									</Grid>
									<ControlTemplate.Triggers>
										<Trigger Property="IsEnabled" Value="False">
											<Setter Property="Fill" TargetName="Arrow" Value="#FFAFAFAF"/>
										</Trigger>
									</ControlTemplate.Triggers>
								</ControlTemplate>
							</Setter.Value>
						</Setter>
					</Style>
				</Setter.Value>
			</Setter>
			<Setter Property="Focusable" Value="False"/>
			<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type xctk:ColorPicker}">
						<Grid>
							<ToggleButton x:Name="PART_ColorPickerToggleButton" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="True" IsChecked="{Binding IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinHeight="22" Padding="{TemplateBinding Padding}" Style="{TemplateBinding ButtonStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" BorderThickness="0" Background="{x:Null}" BorderBrush="{x:Null}">
								<ToggleButton.IsHitTestVisible>
									<Binding Path="IsOpen" RelativeSource="{RelativeSource TemplatedParent}">
										<Binding.Converter>
											<xctk:InverseBoolConverter/>
										</Binding.Converter>
									</Binding>
								</ToggleButton.IsHitTestVisible>
								<Grid Margin="2">
									<ContentControl x:Name="ColorOnly">
										<ContentControl.Style>
											<Style TargetType="{x:Type ContentControl}">
												<Setter Property="ContentTemplate">
													<Setter.Value>
														<DataTemplate>
															<Border>
																<Border.Background>
																	<DrawingBrush TileMode="Tile" Viewport="0,0,10,10" ViewportUnits="Absolute">
																		<DrawingBrush.Drawing>
																			<DrawingGroup>
																				<GeometryDrawing Brush="White">
																					<GeometryDrawing.Geometry>
																						<RectangleGeometry Rect="0,0,100,100"/>
																					</GeometryDrawing.Geometry>
																				</GeometryDrawing>
																				<GeometryDrawing Brush="LightGray">
																					<GeometryDrawing.Geometry>
																						<GeometryGroup>
																							<RectangleGeometry Rect="0,0,50,50"/>
																							<RectangleGeometry Rect="50,50,50,50"/>
																						</GeometryGroup>
																					</GeometryDrawing.Geometry>
																				</GeometryDrawing>
																			</DrawingGroup>
																		</DrawingBrush.Drawing>
																	</DrawingBrush>
																</Border.Background>
																<Rectangle>
																	<Rectangle.Fill>
																		<Binding Path="SelectedColor" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type xctk:ColorPicker}}">
																			<Binding.Converter>
																				<xctk:ColorToSolidColorBrushConverter/>
																			</Binding.Converter>
																		</Binding>
																	</Rectangle.Fill>
																</Rectangle>
															</Border>
														</DataTemplate>
													</Setter.Value>
												</Setter>
											</Style>
										</ContentControl.Style>
									</ContentControl>
									<Border x:Name="ColorAndName" Background="White" Visibility="Hidden">
										<StackPanel Orientation="Horizontal">
											<ContentControl BorderBrush="#FFC9CACA" BorderThickness="1" HorizontalAlignment="Left" Margin="2,1,4,1" Width="20">
												<ContentControl.Style>
													<Style TargetType="{x:Type ContentControl}">
														<Setter Property="ContentTemplate">
															<Setter.Value>
																<DataTemplate>
																	<Border>
																		<Border.Background>
																			<DrawingBrush TileMode="Tile" Viewport="0,0,10,10" ViewportUnits="Absolute">
																				<DrawingBrush.Drawing>
																					<DrawingGroup>
																						<GeometryDrawing Brush="White">
																							<GeometryDrawing.Geometry>
																								<RectangleGeometry Rect="0,0,100,100"/>
																							</GeometryDrawing.Geometry>
																						</GeometryDrawing>
																						<GeometryDrawing Brush="LightGray">
																							<GeometryDrawing.Geometry>
																								<GeometryGroup>
																									<RectangleGeometry Rect="0,0,50,50"/>
																									<RectangleGeometry Rect="50,50,50,50"/>
																								</GeometryGroup>
																							</GeometryDrawing.Geometry>
																						</GeometryDrawing>
																					</DrawingGroup>
																				</DrawingBrush.Drawing>
																			</DrawingBrush>
																		</Border.Background>
																		<Rectangle>
																			<Rectangle.Fill>
																				<Binding Path="SelectedColor" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type xctk:ColorPicker}}">
																					<Binding.Converter>
																						<xctk:ColorToSolidColorBrushConverter/>
																					</Binding.Converter>
																				</Binding>
																			</Rectangle.Fill>
																		</Rectangle>
																	</Border>
																</DataTemplate>
															</Setter.Value>
														</Setter>
													</Style>
												</ContentControl.Style>
											</ContentControl>
											<TextBlock Text="{Binding SelectedColorText, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"/>
										</StackPanel>
									</Border>
								</Grid>
							</ToggleButton>
							<Popup x:Name="PART_ColorPickerPalettePopup" AllowsTransparency="True" Focusable="False" HorizontalOffset="1" IsOpen="{Binding IsChecked, ElementName=PART_ColorPickerToggleButton}" PopupAnimation="Slide" StaysOpen="False" VerticalOffset="1" VerticalAlignment="Bottom">
								<Border BorderThickness="1" Padding="3" BorderBrush="#FF008BFF">
									<Border.Background>
										<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
											<GradientStop Color="White" Offset="0"/>
											<GradientStop Color="#FFE8EBED" Offset="1"/>
										</LinearGradientBrush>
									</Border.Background>
									<Grid>
										<Grid.RowDefinitions>
											<RowDefinition Height="Auto"/>
											<RowDefinition/>
											<RowDefinition Height="Auto"/>
										</Grid.RowDefinitions>
										<Grid x:Name="_colorPaletteHost" Margin="4" Visibility="Collapsed">
											<Grid.RowDefinitions>
												<RowDefinition Height="Auto"/>
												<RowDefinition Height="Auto"/>
												<RowDefinition Height="Auto"/>
												<RowDefinition Height="Auto"/>
											</Grid.RowDefinitions>
											<Grid Grid.Row="1">
												<Grid.Visibility>
													<TemplateBinding Property="ShowAvailableColors">
														<TemplateBinding.Converter>
															<BooleanToVisibilityConverter/>
														</TemplateBinding.Converter>
													</TemplateBinding>
												</Grid.Visibility>
												<Grid>
													<Grid.RowDefinitions>
														<RowDefinition Height="Auto"/>
														<RowDefinition/>
													</Grid.RowDefinitions>
													<TextBlock Background="AliceBlue" Margin="0,0,0,1" Padding="2" Text="{TemplateBinding AvailableColorsHeader}"/>
													<ListBox x:Name="PART_AvailableColors" Grid.Row="1">
														<ListBox.Style>
															<Style TargetType="{x:Type ListBox}">
																<Setter Property="Background" Value="Transparent"/>
																<Setter Property="BorderThickness" Value="0"/>
																<Setter Property="ItemsPanel">
																	<Setter.Value>
																		<ItemsPanelTemplate>
																			<WrapPanel IsItemsHost="True" Width="200"/>
																		</ItemsPanelTemplate>
																	</Setter.Value>
																</Setter>
																<Setter Property="ItemContainerStyle">
																	<Setter.Value>
																		<Style TargetType="{x:Type ListBoxItem}">
																			<Setter Property="ToolTip" Value="{Binding Name}"/>
																			<Setter Property="Template">
																				<Setter.Value>
																					<ControlTemplate TargetType="{x:Type ListBoxItem}">
																						<Grid ToolTip="{Binding Name}">
																							<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
																							<Border x:Name="_outerBorder" BorderBrush="Transparent" BorderThickness="1" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
																								<Border x:Name="_innerBorder" BorderBrush="Transparent" BorderThickness="1" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
																							</Border>
																						</Grid>
																						<ControlTemplate.Triggers>
																							<Trigger Property="IsMouseOver" Value="True">
																								<Setter Property="BorderBrush" TargetName="_outerBorder" Value="Red"/>
																								<Setter Property="BorderBrush" TargetName="_innerBorder" Value="Yellow"/>
																							</Trigger>
																							<Trigger Property="IsSelected" Value="True">
																								<Setter Property="BorderBrush" TargetName="_outerBorder" Value="Red"/>
																								<Setter Property="BorderBrush" TargetName="_innerBorder" Value="Yellow"/>
																							</Trigger>
																						</ControlTemplate.Triggers>
																					</ControlTemplate>
																				</Setter.Value>
																			</Setter>
																		</Style>
																	</Setter.Value>
																</Setter>
																<Setter Property="ItemTemplate">
																	<Setter.Value>
																		<DataTemplate>
																			<Grid>
																				<Border BorderBrush="Black" BorderThickness="1" Margin="2">
																					<Border.Background>
																						<DrawingBrush TileMode="Tile" Viewport="0,0,10,10" ViewportUnits="Absolute">
																							<DrawingBrush.Drawing>
																								<DrawingGroup>
																									<GeometryDrawing Brush="White">
																										<GeometryDrawing.Geometry>
																											<RectangleGeometry Rect="0,0,100,100"/>
																										</GeometryDrawing.Geometry>
																									</GeometryDrawing>
																									<GeometryDrawing Brush="LightGray">
																										<GeometryDrawing.Geometry>
																											<GeometryGroup>
																												<RectangleGeometry Rect="0,0,50,50"/>
																												<RectangleGeometry Rect="50,50,50,50"/>
																											</GeometryGroup>
																										</GeometryDrawing.Geometry>
																									</GeometryDrawing>
																								</DrawingGroup>
																							</DrawingBrush.Drawing>
																						</DrawingBrush>
																					</Border.Background>
																					<Rectangle Height="14" Width="14">
																						<Rectangle.Style>
																							<Style TargetType="{x:Type Rectangle}">
																								<Setter Property="Fill">
																									<Setter.Value>
																										<Binding Path="Color">
																											<Binding.Converter>
																												<xctk:ColorToSolidColorBrushConverter/>
																											</Binding.Converter>
																										</Binding>
																									</Setter.Value>
																								</Setter>
																							</Style>
																						</Rectangle.Style>
																					</Rectangle>
																				</Border>
																			</Grid>
																		</DataTemplate>
																	</Setter.Value>
																</Setter>
																<Setter Property="SelectionMode" Value="Single"/>
															</Style>
														</ListBox.Style>
													</ListBox>
												</Grid>
											</Grid>
											<Grid Grid.Row="2">
												<Grid.Visibility>
													<TemplateBinding Property="ShowStandardColors">
														<TemplateBinding.Converter>
															<BooleanToVisibilityConverter/>
														</TemplateBinding.Converter>
													</TemplateBinding>
												</Grid.Visibility>
												<Grid>
													<Grid.RowDefinitions>
														<RowDefinition Height="Auto"/>
														<RowDefinition Height="Auto"/>
													</Grid.RowDefinitions>
													<TextBlock Background="AliceBlue" Margin="0,1" Padding="2" Text="{TemplateBinding StandardColorsHeader}"/>
													<ListBox x:Name="PART_StandardColors" Grid.Row="1">
														<ListBox.Style>
															<Style TargetType="{x:Type ListBox}">
																<Setter Property="Background" Value="Transparent"/>
																<Setter Property="BorderThickness" Value="0"/>
																<Setter Property="ItemsPanel">
																	<Setter.Value>
																		<ItemsPanelTemplate>
																			<WrapPanel IsItemsHost="True" Width="200"/>
																		</ItemsPanelTemplate>
																	</Setter.Value>
																</Setter>
																<Setter Property="ItemContainerStyle">
																	<Setter.Value>
																		<Style TargetType="{x:Type ListBoxItem}">
																			<Setter Property="ToolTip" Value="{Binding Name}"/>
																			<Setter Property="Template">
																				<Setter.Value>
																					<ControlTemplate TargetType="{x:Type ListBoxItem}">
																						<Grid ToolTip="{Binding Name}">
																							<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
																							<Border x:Name="_outerBorder" BorderBrush="Transparent" BorderThickness="1" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
																								<Border x:Name="_innerBorder" BorderBrush="Transparent" BorderThickness="1" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
																							</Border>
																						</Grid>
																						<ControlTemplate.Triggers>
																							<Trigger Property="IsMouseOver" Value="True">
																								<Setter Property="BorderBrush" TargetName="_outerBorder" Value="Red"/>
																								<Setter Property="BorderBrush" TargetName="_innerBorder" Value="Yellow"/>
																							</Trigger>
																							<Trigger Property="IsSelected" Value="True">
																								<Setter Property="BorderBrush" TargetName="_outerBorder" Value="Red"/>
																								<Setter Property="BorderBrush" TargetName="_innerBorder" Value="Yellow"/>
																							</Trigger>
																						</ControlTemplate.Triggers>
																					</ControlTemplate>
																				</Setter.Value>
																			</Setter>
																		</Style>
																	</Setter.Value>
																</Setter>
																<Setter Property="ItemTemplate">
																	<Setter.Value>
																		<DataTemplate>
																			<Grid>
																				<Border BorderBrush="Black" BorderThickness="1" Margin="2">
																					<Border.Background>
																						<DrawingBrush TileMode="Tile" Viewport="0,0,10,10" ViewportUnits="Absolute">
																							<DrawingBrush.Drawing>
																								<DrawingGroup>
																									<GeometryDrawing Brush="White">
																										<GeometryDrawing.Geometry>
																											<RectangleGeometry Rect="0,0,100,100"/>
																										</GeometryDrawing.Geometry>
																									</GeometryDrawing>
																									<GeometryDrawing Brush="LightGray">
																										<GeometryDrawing.Geometry>
																											<GeometryGroup>
																												<RectangleGeometry Rect="0,0,50,50"/>
																												<RectangleGeometry Rect="50,50,50,50"/>
																											</GeometryGroup>
																										</GeometryDrawing.Geometry>
																									</GeometryDrawing>
																								</DrawingGroup>
																							</DrawingBrush.Drawing>
																						</DrawingBrush>
																					</Border.Background>
																					<Rectangle Height="14" Width="14">
																						<Rectangle.Style>
																							<Style TargetType="{x:Type Rectangle}">
																								<Setter Property="Fill">
																									<Setter.Value>
																										<Binding Path="Color">
																											<Binding.Converter>
																												<xctk:ColorToSolidColorBrushConverter/>
																											</Binding.Converter>
																										</Binding>
																									</Setter.Value>
																								</Setter>
																							</Style>
																						</Rectangle.Style>
																					</Rectangle>
																				</Border>
																			</Grid>
																		</DataTemplate>
																	</Setter.Value>
																</Setter>
																<Setter Property="SelectionMode" Value="Single"/>
															</Style>
														</ListBox.Style>
													</ListBox>
												</Grid>
											</Grid>
											<Grid Margin="0,1" Grid.Row="3">
												<Grid.Visibility>
													<TemplateBinding Property="ShowRecentColors">
														<TemplateBinding.Converter>
															<BooleanToVisibilityConverter/>
														</TemplateBinding.Converter>
													</TemplateBinding>
												</Grid.Visibility>
												<Grid>
													<Grid.RowDefinitions>
														<RowDefinition Height="Auto"/>
														<RowDefinition Height="Auto"/>
													</Grid.RowDefinitions>
													<TextBlock Background="AliceBlue" Margin="0,1" Padding="2" Text="{TemplateBinding RecentColorsHeader}"/>
													<ListBox x:Name="PART_RecentColors" Grid.Row="1">
														<ListBox.Style>
															<Style TargetType="{x:Type ListBox}">
																<Setter Property="Background" Value="Transparent"/>
																<Setter Property="BorderThickness" Value="0"/>
																<Setter Property="ItemsPanel">
																	<Setter.Value>
																		<ItemsPanelTemplate>
																			<WrapPanel IsItemsHost="True" Width="200"/>
																		</ItemsPanelTemplate>
																	</Setter.Value>
																</Setter>
																<Setter Property="ItemContainerStyle">
																	<Setter.Value>
																		<Style TargetType="{x:Type ListBoxItem}">
																			<Setter Property="ToolTip" Value="{Binding Name}"/>
																			<Setter Property="Template">
																				<Setter.Value>
																					<ControlTemplate TargetType="{x:Type ListBoxItem}">
																						<Grid ToolTip="{Binding Name}">
																							<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
																							<Border x:Name="_outerBorder" BorderBrush="Transparent" BorderThickness="1" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
																								<Border x:Name="_innerBorder" BorderBrush="Transparent" BorderThickness="1" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
																							</Border>
																						</Grid>
																						<ControlTemplate.Triggers>
																							<Trigger Property="IsMouseOver" Value="True">
																								<Setter Property="BorderBrush" TargetName="_outerBorder" Value="Red"/>
																								<Setter Property="BorderBrush" TargetName="_innerBorder" Value="Yellow"/>
																							</Trigger>
																							<Trigger Property="IsSelected" Value="True">
																								<Setter Property="BorderBrush" TargetName="_outerBorder" Value="Red"/>
																								<Setter Property="BorderBrush" TargetName="_innerBorder" Value="Yellow"/>
																							</Trigger>
																						</ControlTemplate.Triggers>
																					</ControlTemplate>
																				</Setter.Value>
																			</Setter>
																		</Style>
																	</Setter.Value>
																</Setter>
																<Setter Property="ItemTemplate">
																	<Setter.Value>
																		<DataTemplate>
																			<Grid>
																				<Border BorderBrush="Black" BorderThickness="1" Margin="2">
																					<Border.Background>
																						<DrawingBrush TileMode="Tile" Viewport="0,0,10,10" ViewportUnits="Absolute">
																							<DrawingBrush.Drawing>
																								<DrawingGroup>
																									<GeometryDrawing Brush="White">
																										<GeometryDrawing.Geometry>
																											<RectangleGeometry Rect="0,0,100,100"/>
																										</GeometryDrawing.Geometry>
																									</GeometryDrawing>
																									<GeometryDrawing Brush="LightGray">
																										<GeometryDrawing.Geometry>
																											<GeometryGroup>
																												<RectangleGeometry Rect="0,0,50,50"/>
																												<RectangleGeometry Rect="50,50,50,50"/>
																											</GeometryGroup>
																										</GeometryDrawing.Geometry>
																									</GeometryDrawing>
																								</DrawingGroup>
																							</DrawingBrush.Drawing>
																						</DrawingBrush>
																					</Border.Background>
																					<Rectangle Height="14" Width="14">
																						<Rectangle.Style>
																							<Style TargetType="{x:Type Rectangle}">
																								<Setter Property="Fill">
																									<Setter.Value>
																										<Binding Path="Color">
																											<Binding.Converter>
																												<xctk:ColorToSolidColorBrushConverter/>
																											</Binding.Converter>
																										</Binding>
																									</Setter.Value>
																								</Setter>
																							</Style>
																						</Rectangle.Style>
																					</Rectangle>
																				</Border>
																			</Grid>
																		</DataTemplate>
																	</Setter.Value>
																</Setter>
																<Setter Property="SelectionMode" Value="Single"/>
															</Style>
														</ListBox.Style>
													</ListBox>
												</Grid>
											</Grid>
										</Grid>
										<Grid x:Name="_colorCanvasHost" Visibility="Collapsed">
											<xctk:ColorCanvas BorderThickness="0" Background="Transparent" SelectedColor="{Binding SelectedColor, RelativeSource={RelativeSource TemplatedParent}}" UsingAlphaChannel="{Binding UsingAlphaChannel, RelativeSource={RelativeSource TemplatedParent}}"/>
										</Grid>
										<Separator HorizontalAlignment="Stretch" Margin="5,0" Grid.Row="1">
											<Separator.Visibility>
												<TemplateBinding Property="ShowAdvancedButton">
													<TemplateBinding.Converter>
														<BooleanToVisibilityConverter/>
													</TemplateBinding.Converter>
												</TemplateBinding>
											</Separator.Visibility>
										</Separator>
										<Button x:Name="PART_ColorModeButton" Margin="5" Grid.Row="2">
											<Button.Visibility>
												<TemplateBinding Property="ShowAdvancedButton">
													<TemplateBinding.Converter>
														<BooleanToVisibilityConverter/>
													</TemplateBinding.Converter>
												</TemplateBinding>
											</Button.Visibility>
										</Button>
									</Grid>
								</Border>
							</Popup>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="DisplayColorAndName" Value="True">
								<Setter Property="Visibility" TargetName="ColorOnly" Value="Collapsed"/>
								<Setter Property="Visibility" TargetName="ColorAndName" Value="Visible"/>
							</Trigger>
							<Trigger Property="ColorMode" Value="ColorPalette">
								<Setter Property="Visibility" TargetName="_colorPaletteHost" Value="Visible"/>
								<Setter Property="Visibility" TargetName="_colorCanvasHost" Value="Collapsed"/>
								<Setter Property="Content" TargetName="PART_ColorModeButton" Value="Advanced"/>
							</Trigger>
							<Trigger Property="ColorMode" Value="ColorCanvas">
								<Setter Property="Visibility" TargetName="_colorPaletteHost" Value="Collapsed"/>
								<Setter Property="Visibility" TargetName="_colorCanvasHost" Value="Visible"/>
								<Setter Property="Content" TargetName="PART_ColorModeButton" Value="Standard"/>
							</Trigger>
							<Trigger Property="ShowDropDownButton" Value="False">
								<Setter Property="BorderThickness" Value="1"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</xctk:ColorPicker.Resources>
	
	

	
</xctk:ColorPicker>